package Test;

import org.junit.Assert;
import org.junit.Test;

import Command.Update;

public class TestUpdate {
	
	@Test
	public void testExecuteQuery()
	{
		// Test Case 1
		Update updateCmd = new Update("");
		updateCmd.setDbName("DB_Test");
		updateCmd.setSql("update NhanVien set MaNV = 26 where MaNV = 328 ");		
		Object actual1 = updateCmd.executeQuery();
		Assert.assertEquals("TC 1", "Update 1 row(s) successful", actual1);
		
		// Test Case 2
		updateCmd.setSql("update NhanVien set MaNV = 328 where MaNV = 26 ");		
		Object actual2 = updateCmd.executeQuery();
		Assert.assertEquals("TC 2", "Update 1 row(s) successful", actual2);
	}
}
